﻿using BusinessLogicLayer;
using IBusinessLogicLayer;
using Model.Extend_Model;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace One.Test.MVC.Controllers
{
    /// <summary>
    ///  教师的控制器
    /// </summary>
    public class TeacherController : Controller
    {
        /// <summary>
        ///  教师主页
        /// </summary>
        /// <returns></returns>
        public ActionResult Index()
        {
            return View();
        }

        /// <summary>
        ///  教师首页
        /// </summary>
        /// <returns></returns>
        public ActionResult Welcome()
        {
            return View();
        }

        /// <summary>
        ///  登录人信息
        /// </summary>
        /// <returns></returns>
        public ActionResult UserMessage()
        {
            //获取登录人的用户编号
            var userId = Session["userId"];
            ITeacher_ExtendBusinessLogicLayer Sys = new Teacher_ExtendBusinessLogicLayer();
            List<Teacher_Extend> TeacherList = Sys.GetTeacherList();
            SqlParameter[]
                       Parameter = new SqlParameter[]{
                            new SqlParameter("@Id",userId)
                           };

            Teacher_Extend teacher = TeacherList.FirstOrDefault();
            return View(teacher);
            //return View();
        }

        /// <summary>
        /// 考试列表
        /// </summary>
        /// <returns></returns>
        public ActionResult TestList()
        {
            return View();
        }

        /// <summary>
        /// 学生成绩列表
        /// </summary>
        /// <returns></returns>
        public ActionResult StudentScoreList()
        {
            return View();
        }
    }
}
